package com.cd.system.jpa.entityImport;

import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
* @description 触发器详细信息表 ||  || 
* @author admin
* @date 2024-03-25
*/
@Entity
@Data
@Table(name = "qrtz_triggers",
        indexes =     @Index(name = "sched_name", columnList = "sched_name ,job_name ,job_group")
)
public class QrtzTriggers implements Serializable {

    private static final long serialVersionUID = 1L;

    @EmbeddedId
    private QrtzTriggersKey id;

    //@Comment("qrtz_job_details表job_name的外键")
    @Column(name = "job_name", nullable = false)
    private String jobName;

//    @ManyToOne jpa中不能两个都为主键 这里暂时废弃
//    @JoinColumn(name = "sched_name") // 这个可以生成索引referencedColumnName = "sched_name")
//    @JoinColumn(name = "job_name")
//    @JoinColumn(name = "job_group")
//    private QrtzJobDetails qrtzJobDetails;

    //@Comment("qrtz_job_details表job_group的外键")
    @Column(name = "job_group", nullable = false )
    private String jobGroup;

    //@Comment("相关介绍")
    @Column(name = "description" )
    private String description;

    //@Comment("上一次触发时间（毫秒）")
    @Column(name = "next_fire_time" )
    private Long nextFireTime;

    //@Comment("下一次触发时间（默认为-1表示不触发）")
    @Column(name = "prev_fire_time" )
    private Long prevFireTime;

    //@Comment("优先级")
    @Column(name = "priority" )
    private Long priority;

    //@Comment("触发器状态")
    @Column(name = "trigger_state", nullable = false )
    private String triggerState;

    //@Comment("触发器的类型")
    @Column(name = "trigger_type", nullable = false )
    private String triggerType;

    //@Comment("开始时间")
    @Column(name = "start_time", nullable = false )
    private Long startTime;

    //@Comment("结束时间")
    @Column(name = "end_time" )
    private Long endTime;

    //@Comment("日程表名称")
    @Column(name = "calendar_name" )
    private String calendarName;

    //@Comment("补偿执行的策略")
    @Column(name = "misfire_instr" )
    private Long misfireInstr;

    //@Comment("存放持久化job对象")
    @Column(name = "job_data" )
    private String jobData;

}

